package layers.ants;

public class Mark {
	
	private int agentId;
	private int timeToLive;
	private long distance;
	
	public Mark(int truckId, int ttl, long distance){
		if(ttl < 1)
			throw new IllegalArgumentException("Time to live must be positive.");
		this.agentId = truckId;
		this.timeToLive = ttl;
		this.distance = distance;
	}
	
	public boolean equals(Mark mark){
		return this.getTruckId() == mark.getTruckId();
	}
	
	public int getTruckId(){
		return this.agentId;
	}
	
	public void decreaseTimeToLive(){
		this.timeToLive--;
	}
	
	public boolean isDead(){
		return this.timeToLive == 0;
	}

	public long getDistance() {
		return distance;
	}
}
